scheduler: small csched_cpu_pick() adjustments
authorKeir Fraser <keir.fraser@citrix.com>
Wed, 28 Oct 2009 10:56:39 +0000 (10:56 +0000)
committerKeir Fraser <keir.fraser@citrix.com>
Wed, 28 Oct 2009 10:56:39 +0000 (10:56 +0000)
commitde349fe6b08c398a694818e5393111cc2dbecf9d
tree229b32259fa75adc78f24b6509c88fc4b4c3b099
parent9119667be235cc7dcb67b76e71640fec0f434555
scheduler: small csched_cpu_pick() adjustments

When csched_cpu_pick() decides to move a vCPU to a different pCPU, so
far in the vast majority of cases it selected the first core/thread of
the most idle socket/core. When there are many short executing
entities, this will generally lead to them not getting evenly
distributed (since primary cores/threads will be preferred), making
the need for subsequent migration more likely. Instead, candidate
cores/threads should get treated as symmetrically as possible, and
hence this changes the selection logic to cycle through all
candidates.

Further, since csched_cpu_pick() will never move a vCPU between
threads of the same core (and since the weights calculated for
individual threads of the same core are always identical), rather than
removing just the selected pCPU from the mask that still needs looking
at, all siblings of the chosen pCPU can be removed at once without
affecting the outcome.

Signed-off-by: Jan Beulich <jbeulich@novell.com>
xen/common/sched_credit.c